<?php
namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Logic\Api\UploadLogic;
use App\Http\Requests\Api\Upload\Create;
use App\Http\Requests\Api\Upload\IdCard;
use App\Models\AdminConfig;
use Exception;
use Illuminate\Http\JsonResponse;

class ConfigController extends Controller
{


    public function lists()
    {
        try {
            $res['type'] = AdminConfig::where('type',1)->orderBy('sort','desc')->orderBy('pinying')->get()->toArray();
            $res['level'] = AdminConfig::where('type',2)->orderBy('sort','desc')->orderBy('pinying')->get()->toArray();
            $res['source'] = AdminConfig::where('type',3)->orderBy('sort','desc')->orderBy('pinying')->get()->toArray();
            return $this->success($res);
        } catch (Exception $e) {
            return $this->error($e->getMessage());
        }
    }


}
